﻿<UserControl x:Class="BingSpatialDataServiceExcelAddin.Views.UploadPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:controls="clr-namespace:BingSpatialDataServiceExcelAddin.Controls"
             Height="250" Width="440">

    <UserControl.Resources>
        <Style TargetType="{x:Type Control}" x:Key="baseStyle">
            <Setter Property="FontSize" Value="14" />
        </Style>
        <Style TargetType="{x:Type Button}" BasedOn="{StaticResource baseStyle}"></Style>
        <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource baseStyle}"></Style>
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="FontSize" Value="14"/>
        </Style>
    </UserControl.Resources>
    
    <Grid>
        <Grid Name="InputPanel" Visibility="Visible">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="150"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <TextBlock Text="Data Source Name:" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="5"/>
            <TextBox Name="DSNameTbx" VerticalAlignment="Bottom" Grid.Column="1" Width="270" Height="20" Margin="5"/>

            <TextBlock Text="Entity Type Name:" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="5" Grid.Row="1"/>
            <TextBox Name="EntityTypeTbx" VerticalAlignment="Bottom" Grid.Row="1" Grid.Column="1" Width="270" Height="20" Margin="5"/>

            <TextBlock Text="Master Key:" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="5" Grid.Row="2"/>
            <TextBox Name="MasterKeyTbx" VerticalAlignment="Bottom" Grid.Row="2" Grid.Column="1" Width="270" Height="20" Margin="5"/>

            <TextBlock Text="Query Key (Optional):" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="5" Grid.Row="3"/>
            <TextBox Name="QueryKeyTbx" VerticalAlignment="Bottom" Grid.Row="3" Grid.Column="1" Width="270" Height="20" Margin="5"/>

            <TextBlock Text="Make Public:" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="5" Grid.Row="4"/>
            <CheckBox Name="MakePublicChbx" VerticalAlignment="Bottom" Grid.Row="4" Grid.Column="1" Margin="5"/>

            <TextBlock Text="Skip Geocoding:" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="5" Grid.Row="5"/>
            <CheckBox Name="SkipGeocodingChbx" VerticalAlignment="Bottom" Grid.Row="5" Grid.Column="1" Margin="5"/>

            <StackPanel Grid.Row="6" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="10">
                <Button Content="Upload" Click="UploadBtn_Click" Height="25" Width="80"/>
                <Button Content="Cancel" Click="CancelBtn_Click" Height="25" Width="80" Margin="10,0,0,0"/>
            </StackPanel>
        </Grid>

        <Grid Name="StatusPanel" Visibility="Collapsed" Margin="10">
            <Grid.RowDefinitions>
                <RowDefinition Height="50"/>
                <RowDefinition Height="50"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <TextBlock Text="Uploading Data Source. This may take several minutes." Grid.ColumnSpan="2"/>

            <TextBlock Text="Status:" Grid.Row="1" VerticalAlignment="Center"/>
            <TextBox Name="Status" IsEnabled="False" Grid.Row="1" Grid.Column="1" Width="330" Height="20"/>

            <StackPanel VerticalAlignment="Center" Grid.ColumnSpan="2" Grid.Row="2" HorizontalAlignment="Center">
                <ProgressBar IsIndeterminate="True" Height="25" Width="200"/>
                <controls:TimerTextBlock x:Name="ElapsedTimer" IsCountDown="False" Width="150" TextAlignment="Center" FontSize="24" Padding="10"/>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
